﻿@using SmartStore.PayPal.Models;
@using SmartStore.Web.Framework;
@model PayPalStandardConfigurationModel
@{
	Layout = "";
}

<div class="plugin-actions">
	<button type="submit" name="save" class="btn btn-warning" value="save">
		<i class="fa fa-check"></i>
		<span>@T("Admin.Common.Save")</span>
	</button>
</div>

<div class="plugin-configuration">
	<div>
		<div class="alert alert-info alert-dismissible">
			@Html.Raw(T("Plugins.Payments.PayPalStandard.AdminInstruction"))
			<button class="close" data-dismiss="alert">&times;</button>
		</div>
	</div>
	<div>
		<a href="https://www.paypal.com/" target="_blank">
			<img src="@Url.Content("~/Plugins/SmartStore.PayPal/Content/branding.png")" alt="PayPal" />
		</a>
	</div>
</div>

@{ Html.RenderAction("StoreScopeConfiguration", "Setting", new { area = "Admin" }); }

@using (Html.BeginForm())
{
    <table class="adminContent configure-paypal-standard">
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.UseSandbox)
            </td>
            <td class="adminData">
				@*multistore context not possible, see IPN handling*@
                @Html.EditorFor(model => model.UseSandbox)
                @Html.ValidationMessageFor(model => model.UseSandbox)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.BusinessEmail)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.BusinessEmail)
                @Html.ValidationMessageFor(model => model.BusinessEmail)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.PdtToken)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.PdtToken)
                @Html.ValidationMessageFor(model => model.PdtToken)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.PdtValidateOrderTotal)
            </td>
			<td class="adminData">
				@Html.SettingEditorFor(model => model.PdtValidateOrderTotal,
					Html.CheckBoxFor(model => model.PdtValidateOrderTotal, new { data_toggler_for = "#PdtValidateOnlyWarnContainer" }))
				@Html.ValidationMessageFor(model => model.PdtValidateOrderTotal)
			</td>
        </tr>
		<tr id="PdtValidateOnlyWarnContainer">
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.PdtValidateOnlyWarn)
			</td>
			<td class="adminData">
				@Html.SettingEditorFor(model => model.PdtValidateOnlyWarn)
				@Html.ValidationMessageFor(model => model.PdtValidateOnlyWarn)
			</td>
		</tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AdditionalFee)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.AdditionalFee, null, new { postfix = Model.PrimaryStoreCurrencyCode })
                @Html.ValidationMessageFor(model => model.AdditionalFee)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AdditionalFeePercentage)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.AdditionalFeePercentage)
                @Html.ValidationMessageFor(model => model.AdditionalFeePercentage)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.PassProductNamesAndTotals)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.PassProductNamesAndTotals)
                @Html.ValidationMessageFor(model => model.PassProductNamesAndTotals)
            </td>
        </tr>
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.IsShippingAddressRequired)
			</td>
			<td class="adminData">
				@Html.SettingEditorFor(model => model.IsShippingAddressRequired)
				@Html.ValidationMessageFor(model => model.IsShippingAddressRequired)
			</td>
		</tr>
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.UsePayPalAddress)
			</td>
			<td class="adminData">
				@Html.SettingEditorFor(model => model.UsePayPalAddress)
				@Html.ValidationMessageFor(model => model.UsePayPalAddress)
			</td>
		</tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.EnableIpn)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.EnableIpn, 
					Html.CheckBoxFor(model => model.EnableIpn, new { data_toggler_for = ".ipn-handling" }))
                @Html.ValidationMessageFor(model => model.EnableIpn)
            </td>
        </tr>
		<tr class="ipn-handling">
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.IpnChangesPaymentStatus)
			</td>
			<td class="adminData">
				@Html.SettingEditorFor(model => model.IpnChangesPaymentStatus)
				@Html.ValidationMessageFor(model => model.IpnChangesPaymentStatus)
			</td>
		</tr>
        <tr class="ipn-handling">
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.IpnUrl)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.IpnUrl)
                @Html.ValidationMessageFor(model => model.IpnUrl)
            </td>
        </tr>
		<tr class="ipn-handling">
			<td colspan="2">
				<div class="alert alert-info">
					@T("Plugins.Payments.PayPalStandard.Fields.EnableIpn.Hint2")
				</div>
			</td>
		</tr>
    </table>
}
